$(document).ready(function(){
	$('#estDetailWindow').window({
	    title: '在线评估',
	    width: 820,
	    height: 450,
	    top: ($(window).height() - 450) * 0.5,
	    left: ($(window).width() - 820) * 0.5,
	    shadow: true,
	    modal: true,
	    closed: true,
	    minimizable: false,
	    maximizable: false,
	    collapsible: false
	});
	$('#grid_est').datagrid({ 
		url:"findEstInfoList.html",
		fit:true,
		fitColumns:true, 
		singleSelect:true,
		pageSize:10,   
	    pageNumber:1,
		columns:[[
			{field:'id',title:'用户Id',width:100,resizable:false,align:'center'}, 
			{field:'name',title:'姓名',width:120,resizable:false,align:'center'},
			{field:'sex',title:'性别',width:60,resizable:false,align:'center'},
			{field:'phone',title:'电话',width:150,resizable:false,align:'center'},
			{field:'schoolRecord',title:'学历',width:120,resizable:false,align:'center'},
			{field:'mail',title:'邮箱',width:150,resizable:false,align:'center'},
			{field:'address',title:'地址',width:200,resizable:false,align:'center'},
			{field:'option',title:'操作',width:60,resizable:false,align:'center',
				formatter:function(value,rowData){
					return "<a  style='font-size:normal;color:#cc0000;cursor:pointer;' onClick=queryDetail('"+rowData.id+"')>【详细】</a>";
					}
			}]],
		pagination:true,
	}); 
});

function queryDetail(id){
	
	$.ajax({
		type: "post",
		url: "findEst.html",
		data:{
			id : id,
		},
		success: function(data, textStatus){
				$("#name").val(data.estBean.name);
				$("#age").val(data.estBean.age);
				$("#sex").val(data.estBean.sex);
				$("#schoolRecord").val(data.estBean.schoolRecord);
				$("#phone").val(data.estBean.phone);
				$("#mail").val(data.estBean.mail);
				$("#address").val(data.estBean.address);
				$("#countries").val(data.estBean.countries);
				$("#planTarget").val(data.estBean.planTarget);
				$("#result").val(data.estBean.result);
				$("#schoolTime").val(data.estBean.schoolTime);
				$("#resultsBackground").val(data.estBean.resultsBackground);
				$("#activity").val(data.estBean.activity);
				$("#schoolTarget").val(data.estBean.schoolTarget);
				$("#requirements").val(data.estBean.requirements);
				$('#estDetailWindow').window('open');
		},
		
	});
	
}

